Get Messages
Get all messages in a chat.
Usage
import { v0 } from 'v0-sdk'const result = await v0.messages.list({ chatId: 'chat_abc123',})console.log(result)API Signature
Request
Path Parameters
The unique identifier of the chat.
Query Parameters
Maximum number of messages to return (1-100, default 20).
Pagination cursor returned from a previous response.
Response
The messages in this page, newest first.
Unique message identifier.
ID of the chat this message belongs to.
Who produced this message.
ISO timestamp when the message was created.
ISO timestamp when the message was last updated.
The trailing prose of the message — the agent’s closing summary, or the user’s message text. Empty string when there is no closing prose.
Ordered list of parts that make up the message. Iterate to render the full narrative including thinking, file operations, tool calls, and prose.
A block of text output by the agent.
Markdown prose written by the agent or user.
ISO timestamp when this part began.
ISO timestamp when this part completed.
Why generation ended. Null while the agent is still generating; once non-null, the message is final and safe to consume.
Files attached to this message.
URL to the attachment.
Original filename, when available.
MIME type.
Size in bytes.
ID of the user who authored a user message; null for assistant messages.
Token usage and credit cost. All values are zero on user messages and on assistant messages that have not yet generated tokens.
Token counts for this message.
Prompt input value (non-cached).
Completion output value.
Cache-read input value.
Cache-write input value.
Sum of input, output, cacheRead, and cacheWrite.
Credit cost for this message.
Prompt input value (non-cached).
Completion output value.
Cache-read input value.
Cache-write input value.
Sum of input, output, cacheRead, and cacheWrite.
Cursor to fetch the next page, or null if there are no more messages.
Get Message
Fetches a single message in a chat.
Resolve Task
Resolves a pending task in a chat, continuing the conversation. The latest message in the active chat fork must be an assistant message currently blocked on a matching task (integration setup, plan approval, question answers, or permission grants). Blocks until the model response is complete and returns the resulting message.